/**
 * created by dt 2025-05-08
 * 技能实例系统
 */

import { System } from "../../core/System";
import { ecs_trait, ecs_trait_property } from "../../core/Trait";
import { ECSkillInstance } from "../components/ECSkillInstance";

@ecs_trait()
class SkillInstanceTrait {
    @ecs_trait_property(ECSkillInstance)
    instance!: ECSkillInstance;
}

export class SkillInstanceSystem extends System {
    onStart(): void {
    }

    onUpdate(deltaTime: number): void {
        this.world.forEach(ECSkillInstance, (bundle) => {
            if (bundle.skillInstance) {
                bundle.skillInstance.update(deltaTime);
            }
        });
    }
}
